<form class="form-horizontal" id="form_receivables" role="form" action="{:U('finance/add','t=receivables')}" method="post" enctype="multipart/form-data">
	<input type='hidden' name="refer_url" value="2"/>
	<div class="col-md-10 add_body_form" >
		<div class="form-group" id="form_contract">
			<label class="col-md-4 control-label">相关合同：</label>
			<div class="col-md-6">
				<input type="hidden" name="contract_id" id="contract_id" value="{$contract_info['contract_id']}"/>
				<input class="form-control required" aria-required="true" type="text" name="contract_name" id="contract_name" value="{$contract_info['number']}" readonly="true" style="cursor:pointer;"/>
			</div>
			<div class="col-md-2"></div>
		</div>
		<div class="form-group" id="form_customer">
			<label class="col-md-4 control-label">{:L('CUSTOMER')}：</label>
			<div class="col-md-6">
				<input name="customer_id" id="customer_id" type="hidden" value="{$contract_info['customer_id']}" />
				<input name="customer" id="customer" class="form-control required" aria-required="true" disabled="true" type="text" value="{$contract_info['customer_name']}" />
			</div>
			<div class="col-md-2"></div>
		</div>
		<div class="form-group">
			<label class="col-md-4 control-label">应收款编号：</label>
			<div class="col-md-6">
				<input name="name" id="name" class="form-control required" aria-required="true" type="text" value="{$number}" />
			</div> 
			<div class="col-md-2"></div>
		</div>
		<div class="form-group">
			<label class="col-md-4 control-label">{:L('AMOUNT OF RECEIVING')}：</label>
			<div class="col-md-6">
				<input class="form-control required" id="price" name="price" type="text" value="{$contract_info['price']}"/>
			</div>
			<div class="col-md-2"></div>
		</div>
		<div class="form-group">
			<label class="col-md-4 control-label">{:L('RECEIVING TIME')}：</label>
			<div class="col-md-6">
				<input onclick="WdatePicker()" class="form-control required Wdate" aria-required="true" type="text" id="pay_time" name="pay_time"/>
			</div>
			<div class="col-md-2"></div>
		</div>
		<div class="form-group">
			<label class="col-md-4 control-label">收款人：</label>
			<div class="col-md-6">
				<input type="hidden" id="owner_role_id" name="owner_role_id" value="{:session('role_id')}" />
				<input class="form-control required" aria-required="true" id="owner_name" name="owner_name" type="text" value="{:session('name')}" readonly="true" style="cursor:pointer;" title="请点击选择"/>
			</div>
			<div class="col-md-2"></div>
		</div>
		<div class="form-group">
			<label class="col-md-4 control-label">{:L('DESCRIPTION')}：</label>
			<div class="col-md-8">
				<textarea class="form-control" rows="5" name="description" id="description"></textarea>
			</div>
		</div>
	</div>
</form>
<div id="dialog-role-list2" style="display:none;" title="{:L('SELECT THE LEADER')}">
	<div class="spiner-example">
		<div class="sk-spinner sk-spinner-three-bounce">
			<div class="sk-bounce1"></div>
			<div class="sk-bounce2"></div>
			<div class="sk-bounce3"></div>
		</div>
	</div>
</div>
<script type="text/javascript">
<if condition="C('ismobile') eq 1">width=$('.container').width() * 0.9;<else/>width=900;</if>
$("#dialog-role-list2").dialog({
	autoOpen: false,
	modal: true,
	width: width,
	maxHeight: 400,
	buttons: {
		"确定": function () {
			var item = $('input:radio[name="owner"]:checked').val();
			var name = $('input:radio[name="owner"]:checked').attr('rel');
			if(item){
				$('#owner_name').val(name);
				$('#owner_role_id').val(item);
			}
			$(this).dialog("close");
		},
		"取消": function () {
			$(this).dialog("close");
		}
	},
	position: ["center", 100]
});

$(function(){
	$("#owner_name").click(
		function(){
			$('#dialog-role-list2').dialog('open');
			$('#dialog-role-list2').load('{:U("user/listDialog","by=all")}');
		}
	);
});
</script>